package cn.edu.ctbu.test.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
public class LogOutController {
    @RequestMapping("/tologout")
    public String logout(HttpSession session)
    {
        System.out.println("logout");
        //session失效

        session.invalidate();
        return "redirect:index";

    }
}
